﻿CREATE PROCEDURE [Tips_update]
	@P_1 Int,
	@P_2 NVarChar(max),
	@P_3 Int,
	@P_4 Int,
	@P_5 Bit,
	@sync_force_write Int,
	@sync_min_timestamp BigInt,
	@sync_row_count Int OUTPUT
AS
BEGIN
SET @sync_row_count = 0; UPDATE [Tips] SET [TipText] = @P_2, [TipCategoryID] = @P_3, [WrittenByUserID] = @P_4, [Approved] = @P_5 FROM [Tips] [base] JOIN [Tips_tracking] [side] ON [base].[TipID] = [side].[TipID] WHERE ([side].[local_update_peer_timestamp] <= @sync_min_timestamp OR @sync_force_write = 1) AND ([base].[TipID] = @P_1); SET @sync_row_count = @@ROWCOUNT;
END